<?php
/**
 *
 * @author Lukas Normantas
 */
class Default_Form_LoginForm extends Zend_Form{
    public function init()
    {
        $this->setMethod('post');

        $router = Zend_Controller_Front::getInstance()->getRouter();
        $action = $router->assemble(array('action'=>'login', 'controller'=>'user', 'module'=>'default'));

        $this->setAction($action);
        
        $request = Zend_Controller_Front::getInstance()->getRequest();
        //Zend_Debug::dump($request->getParams());
        $request_params = $request->getParams();

        $this->addElement('hidden', 'login_attempted_from_request_params', array(
            'label'      => null,
            'required'   => false,

        ));
        $this->getElement('login_attempted_from_request_params')->setValue(serialize($request_params) );

        $this->addElement('text', 'login_email', array(
            'label'      => 'email',
            'required'   => false,

        ));

        $this->addElement('password', 'login_password', array(
            'label'      => 'password',
            'required'   => false,
        ));

        $this->addElement('submit', 'submit', array(
            'label'    => 'login',
        ));
    }
}
